#ifndef List_Iterador_
#define List_Iterador_

#include "List.h"

template <class T> 
class List_Iterator 
{
	private:
		Node<T> * start;	
		Node<T> * act;

	public:
  	    List_Iterator(const List<T> &l) ;
	    List_Iterator(const List_Iterator &lit) ;
		
		T operator ++(int) ;
	    const T& operator *() const ;
 	    void updat (const T& elem) ;
	    bool end() const ;
	    
		List_Iterator<T>& operator = (const List_Iterator<T> &lit);
	    bool operator == (const List_Iterator<T> &lit) const ;
}; 

template <class T> 
List_Iterator<T>::List_Iterator(const List<T> &l) 
{
	start = l.head ;
 	act = start ;
}

template <class T> 
List_Iterator<T>::List_Iterator(const List_Iterator<T> &lit) 
{
	start = lit.start ;
    act = lit.act ;
}


template <class T> 
T List_Iterator<T>::operator ++(int)
{
	T tmp = act->info ;
	
	act = act->next ; 
		
	return tmp ;
}


template <class T> 
const T& List_Iterator<T>::operator *() const 
{
	return act->info ;
}


template <class T> 
void List_Iterator<T>::updat(const T& elem) 
{
	act->info = elem ; 
}  

template <class T> 
bool List_Iterator<T>::end() const 
{
	return act == NULL ;
}


template <class T> 
List_Iterator<T>& List_Iterator<T>::operator= (const List_Iterator<T> &lit) 
{
	start = lit.start ; 
	act = lit.act ;

	return *this ;
}

template <class T> 
bool List_Iterator<T>::operator == (const List_Iterator<T> &lit) const
{
	return (start == lit.start && act == lit.act) ;
}


#endif